package timing.ukulele.storage.entity;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;
import org.springframework.data.mongodb.core.mapping.Field;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * 文件元数据信息表Entity
 **/
@Getter
@Setter
@ToString
@Document("file_metadata_info")
public class MetadataInfoEntity implements Serializable {
    @Id
    private String id;

    @Schema(description = "文件KEY")
    @Field(value = "file_key")
    private String fileKey;

    @Schema(description = "文件md5")
    @Field(value = "file_md5")
    private String fileMd5;

    @Schema(description = "文件名")
    @Field(value = "file_name")
    private String fileName;

    @Schema(description = "MIME类型")
    @Field(value = "file_mime_type")
    private String fileMimeType;

    @Schema(description = "文件后缀")
    @Field(value = "file_suffix")
    private String fileSuffix;

    @Schema(description = "文件长度")
    @Field(value = "file_size")
    private Long fileSize;

    @Schema(description = "存储桶")
    @Field(value = "bucket_")
    private String storageBucket;

    @Schema(description = "存储桶路径")
    @Field(value = "bucket_path")
    private String storagePath;

    @Schema(description = "上传任务id,用于合并切片")
    @Field(value = "upload_id")
    private String uploadTaskId;

    @Schema(description = "状态 0:未完成 1:已完成")
    @Field(value = "is_finished")
    private Boolean isFinished;

    @Schema(description = "是否分块 0:否 1:是")
    @Field(value = "is_part")
    private Boolean isPart;

    @Schema(description = "分块数量")
    @Field(value = "part_number")
    private Integer partNumber;

    @Schema(description = "创建人")
    @Field(value = "create_by")
    private String createBy;

    @Schema(description = "创建时间")
    @Field(value = "create_time")
    private LocalDateTime createTime;

    @Schema(description = "更新时间")
    @Field(value = "update_by")
    private String updateBy;

    @Schema(description = "更新时间")
    @Field(value = "update_time")
    private LocalDateTime updateTime;

    @Schema(description = "是否删除")
    @Field(value = "deleted_")
    private Boolean deleted;

    @Schema(description = "所有者")
    @Field(value = "owner_")
    private String owner;

    @Schema(description = "文件路径")
    @Field(value = "file_path")
    private String filePath;

}